/**
 * create by young (young2f@outlook.com) on 2023/5/12
 */
'use strict';
const fs = require('fs');
const moment = require('moment');
const _ = require('lodash');
const str = fs.readFileSync('./mas/cs.txt', 'utf8');
console.log(str);


function rand(min, max) {
    return Math.ceil(Math.random() * (max - min + 1) + min - 1);
}


const css = str.split('\r\n');
const array = [];
let num = 5;
const csArray = [
    {'马鞍山': 6},
    {'含山县': 8},
    {'和县': 10},
    {'当涂县': 12},
    {'花山区': 14},
    {'雨山区': 16},
    {'博望区': 18},
    {'市经开区': 20},
    {'慈湖高新区': 22},
    {'郑蒲港新区': 24},
];
let base = 600;
for (let yue = 0; yue < 7; yue++) {
    const yum = moment(new Date()).add(yue + 1, 'months').format('YYYY-MM');
    const item = {'月份': yum};
    num++;
    for (let i = 0; i < css.length - 1; i++) {
        /**
         *
         */
        const name = css[i];

        const min = base + (200 * i);
        const max = min + 200;
        item[name] = rand(min, max)/100;
    }
    array.push(item);
}
fs.writeFileSync('./mas/out.json', JSON.stringify(array));
console.log(array);

